From: kfraser@localhost.localdomain Date: Fri, 28 Jul 2006 16:23:15 +0000 (+0100) Subject: [PCI] Pcifront for ia64. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15771 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=6faab8acafcf9e334dcd86a0d0c609522019c416;p=xen.git [PCI] Pcifront for ia64. Added in Kconfig. On ia64, use ia64 sysdata instead of pcifront genuine one. Fix a warning on xenbus.c Signed-off-by: Tristan Gingold --- diff --git a/linux-2.6-xen-sparse/arch/ia64/Kconfig b/linux-2.6-xen-sparse/arch/ia64/Kconfig index 63a5195290..a74eeffde4 100644 --- a/linux-2.6-xen-sparse/arch/ia64/Kconfig +++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig @@ -438,6 +438,21 @@ config PCI_DOMAINS bool default PCI +config XEN_PCIDEV_FRONTEND + bool "Xen PCI Frontend" + depends on PCI && XEN + default y + help + The PCI device frontend driver allows the kernel to import arbitrary + PCI devices from a PCI backend to support PCI driver domains. + +config XEN_PCIDEV_FE_DEBUG + bool "Xen PCI Frontend Debugging" + depends on XEN_PCIDEV_FRONTEND + default n + help + Enables some debug statements within the PCI Frontend. + source "drivers/pci/Kconfig" source "drivers/pci/hotplug/Kconfig" diff --git a/linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c b/linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c index 38906ade6e..6be14aebdc 100644 --- a/linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c +++ b/linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c @@ -105,7 +105,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn, .size = size, }; struct pcifront_sd *sd = bus->sysdata; - struct pcifront_device *pdev = sd->pdev; + struct pcifront_device *pdev = pcifront_get_pdev(sd); if (verbose_request) dev_info(&pdev->xdev->dev, @@ -144,7 +144,7 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn, .value = val, }; struct pcifront_sd *sd = bus->sysdata; - struct pcifront_device *pdev = sd->pdev; + struct pcifront_device *pdev = pcifront_get_pdev(sd); if (verbose_request) dev_info(&pdev->xdev->dev, @@ -207,12 +207,13 @@ int pcifront_scan_root(struct pcifront_device *pdev, err = -ENOMEM; goto err_out; } - sd->domain = domain; - sd->pdev = pdev; + pcifront_init_sd(sd, domain, pdev); - b = pci_scan_bus_parented(&pdev->xdev->dev, bus, &pcifront_bus_ops, sd); + b = pci_scan_bus_parented(&pdev->xdev->dev, bus, + &pcifront_bus_ops, sd); if (!b) { - dev_err(&pdev->xdev->dev, "Error creating PCI Frontend Bus!\n"); + dev_err(&pdev->xdev->dev, + "Error creating PCI Frontend Bus!\n"); err = -ENOMEM; goto err_out; } diff --git a/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c index 10d86812d8..f3a642e5b6 100644 --- a/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "pcifront.h" #define INVALID_GRANT_REF (0) diff --git a/linux-2.6-xen-sparse/include/xen/pcifront.h b/linux-2.6-xen-sparse/include/xen/pcifront.h index 51b170a0fc..17c843ade1 100644 --- a/linux-2.6-xen-sparse/include/xen/pcifront.h +++ b/linux-2.6-xen-sparse/include/xen/pcifront.h @@ -11,16 +11,30 @@ #ifdef __KERNEL__ +#ifndef __ia64__ + struct pcifront_device; +struct pci_bus; struct pcifront_sd { int domain; struct pcifront_device *pdev; }; -struct pci_bus; +static inline struct pcifront_device * +pcifront_get_pdev(struct pcifront_sd *sd) +{ + return sd->pdev; +} -#ifdef CONFIG_PCI_DOMAINS +static inline void pcifront_init_sd(struct pcifront_sd *sd, int domain, + struct pcifront_device *pdev) +{ + sd->domain = domain; + sd->pdev = pdev; +} + +#if defined(CONFIG_PCI_DOMAINS) static inline int pci_domain_nr(struct pci_bus *bus) { struct pcifront_sd *sd = bus->sysdata; @@ -32,6 +46,30 @@ static inline int pci_proc_domain(struct pci_bus *bus) } #endif /* CONFIG_PCI_DOMAINS */ +#else /* __ia64__ */ + +#include +#define pcifront_sd pci_controller + +static inline struct pcifront_device * +pcifront_get_pdev(struct pcifront_sd *sd) +{ + return (struct pcifront_device *)sd->platform_data; +} + +static inline void pcifront_init_sd(struct pcifront_sd *sd, int domain, + struct pcifront_device *pdev) +{ + sd->segment = domain; + sd->acpi_handle = NULL; + sd->iommu = NULL; + sd->windows = 0; + sd->window = NULL; + sd->platform_data = pdev; +} + +#endif /* __ia64__ */ + extern spinlock_t pci_bus_lock; #endif /* __KERNEL__ */